package com.zhxy.controller.api.validate;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class CheckTokenAdvisor {

    private static final Logger logger = LoggerFactory.getLogger(CheckTokenAdvisor.class);

    public void exec() {
        ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletResponse response = attrs.getResponse();
        response.setContentType("text/html;charset=UTF-8");
        try {
            response.getWriter().write("校验token");
        } catch (IOException e) {
            logger.error(e.getMessage(), e);
        }
    }
}
